import React,{Component} from 'react'
import {Menu} from 'antd'
import { withRouter } from 'react-router-dom'


const {SubMenu}=Menu

class EditMenu extends Component{
  render()
  {
    const {data}=this.props
    const go=this.props.history.push
    return (
     <Menu                                      
          
          style={{ height: '100%' }}
        >
        {data.map((item,index)=>{
          return (
          <SubMenu key={"sub"+index} title={item.menuTitle}>
          {
            item.titleArray.map(
              (t,index)=>{
                 // let url={pathname:`/middle`,query:t.contentid};
                 let url =`/admin/werenshi/postedit/${t.contentid}`;
                  return (<Menu.Item key={t.contentid} onClick={()=>{go(url)}}>{t.title}</Menu.Item>)
              }
            )
          }
          </SubMenu>);
        })}
        </Menu>
    )
  }
}
export default withRouter(EditMenu)

